import { GCellRenderer } from "../../../../com/mui/controls/GCellRenderer";
import { ObjCreate } from "../common/ObjCreate";
import { SChaosFightResult } from "../../../../Message/Public/SChaosFightResult";
import { EntityUtil } from "../../scene/layer/utils/EntityUtil";
import { HTMLUtil } from "../../../../com/gengine/utils/HTMLUtil";
import { Language } from "../../../../extend/language/Language";
//class HeroBattleResultRenderer
    
    export  class HeroBattleResultRenderer extends GCellRenderer
    {
        constructor()
        {
            super();
            this._memberTxt = ObjCreate.createGTextField("", 0, 0, 270, 20, this);
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            var loc1=undefined;
            super.data = arg1;
            if (arg1.hasOwnProperty("data")) 
            {
                loc1 = arg1.data;
            }
            else 
            {
                loc1 = arg1;
            }
            var loc2=loc1 as SChaosFightResult;
            var loc3="";
            var loc4="";
            if (EntityUtil.isSameServerByRole(loc2.miniPlayer.entityId)) 
            {
                loc4 = HTMLUtil.addColor(Language.getString(70801), "#FF00FF");
            }
            else 
            {
                loc4 = HTMLUtil.addColor("[" + EntityUtil.getProxyName(loc2.miniPlayer.entityId) + "]", "#FF8040");
            }
            if (loc2.score >= 0) 
            {
                loc3 = Language.getStringByParam(200206, loc2.miniPlayer.name, loc2.score);
            }
            else 
            {
                loc3 = loc2.miniPlayer.name + "：" + Language.getString(200215);
            }
            this._memberTxt.htmlText = loc4 + " " + loc3;
            return;
        }

        /* internal */ /* var */_memberTxt: Object /* flash.text.TextField */;
    }
